# 开发时间: 2024/1/6 22:03

# 字符串分割

s = 'hello world Python'
lst = s.split()     # 默认是以空格为分割符
print(lst)
s1 = 'hello|world|Python'
print(s1.split(sep='|'))
print(s1.split(sep='|', maxsplit=1))
print('--------------------------------')

'''rsplit()从右侧开始劈分'''
s = 'hello world Python'
s1 = 'hello|world|Python'
print(s.rsplit())
print(s1.split('|'))
print(s1.rsplit('|', 1))

